Skip to main content
In the context of SequenceEthereum, a Client is defined by the IEthClient interface. Creating a client requires a Chain. This will use our highly available and responsive Node Gateway service for your RPC requests; accessed using the API key from the Builder you’ve provided in your SequenceConfig scriptable object. If you prefer to use your own RPC URL, you can create a SequenceEthClient using a URL string as a parameter instead. You can create a client using this snippet:

Methods

As your connection point to Ethereum nodes, there are a number of methods that can be performed by a client, these can be found in the IEthClient interface and are implemented by SequenceEthClient. Note: with the exception of BalanceAt (potentially), most users will not need to make use of these methods, but we have included them in our documentation for completeness.

BalanceAt

Used to get the gas currency balance of a given wallet at a given blockNumber (in hexadecimal format provided as a string)
Note: there are two special values for blockNumber. “earliest” will get the balance at the earliest block on the chain. “latest” will get the balance at the latest block on the chain and is the default parameter when none is provided. Otherwise, you’ll want to provide the blockNumber string in hexadecimal format.
Unless you really want to get into the weeds with how things work, it is HIGHLY recommended to move on to the next page of the documentation at this point

BlockByNumber

Used to get the Block with a specific block number.
Note: as above, blockNumber should be in hexadecimal format or special values “ealiest” and “latest”

BlockByHash

Used to get the Block by a specified block hash (string)

BlockNumber

Used to get the most recent block number in hexadecimal format

BlockRange

Used to get a List<Block> from the blocks in a range specified by blockNumbers
Note: as above, blockNumber should be in hexadecimal format or special values “ealiest” and “latest”

ChainID

Used to get the chain id in hexadecimal format for the chain the client is connected to

CodeAt

Used to get the bytecode for a smart contract at a given address in hexadecimal format at a specified blockNumber
Note: as above, blockNumber should be in hexadecimal format or special values “ealiest” and “latest”

EstimateGas

Given a TransactionCall estimate the amount of gas required for the transaction

FeeHistory

Get a FeeHistoryResult for gas fees paid blockCount blocks since newestBlock (blockNumber)
Note: as above, blockNumber should be in hexadecimal format or special values “ealiest” and “latest”

NetworkId

Used to get the chain id in integer format (as string) for the chain the client is connected to

NonceAt

Used to get the recommended nonce for a given Address at a given blockNumber (defaults to “latest”)
Note: as above, blockNumber should be in hexadecimal format or special values “ealiest” and “latest”

SendRawTransaction

Given a signed transaction string, submit the transaction to the network and return a transaction hash

SuggestGasPrice

Used to get a suggested gas price

SuggestGasTipCap

Used to get the max suggested priority fee for gas

TransactionByHash

Used to get a Transaction by transaction hash

TransactionCount

Used to get the number of transactions in a block by block hash

WaitForTransactionReceipt

Provide a transaction hash in order to wait for and return the TransactionReceipt